package com.chinalanshen.mqtt.controller;

import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.chinalanshen.mqtt.service.SendMessage;

@RestController
public class MessageController {
    @Autowired
    SendMessage mqttGateway;
    @RequestMapping("test")
    public String sendMqttMessage() {
        mqttGateway.sendToMqtt(UUID.randomUUID().toString(), "test");
        mqttGateway.sendToMqtt(UUID.randomUUID().toString(), "hello");
        return "ok";
    }
}